package com.monitor.app_monitor.service.impl;//package com.monitoring.exportercollect.service.impl;

import com.monitor.app_monitor.entity.ServiceList;
import com.monitor.app_monitor.service.MonitorService;
import com.monitor.app_monitor.service.quartz.utils.HttpClientUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.HashMap;


@Service("urlAppMonitor")
@Slf4j
public class urlAppMonitor implements MonitorService {


    @Override
    public int receiveCode(ServiceList appInfo) {
        String url = "http://"+appInfo.getHost()+":"+appInfo.getPort()+"/monitor";
        HashMap<String, String> header = new HashMap<>();
        int result = HttpClientUtil.doGet(url,header);
        return result;
    }
}
